﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetfractionHub.Security
{
    public class AccessPermissionComparer : IEqualityComparer<AccessPermissionBase>
    {
        #region IEqualityComparer<AccessPermissionBase> Members

        bool IEqualityComparer<AccessPermissionBase>.Equals(AccessPermissionBase x, AccessPermissionBase y)
        {
            return (x.GetType() == y.GetType() && x.State == y.State);
        }

        int IEqualityComparer<AccessPermissionBase>.GetHashCode(AccessPermissionBase obj)
        {
            if (obj == null)
                return 0;

            return obj.GetType().GetHashCode();
        }

        #endregion
    }
}
